home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / x / volume14 / contool / patch1 next >
Encoding:
Internet Message Format  |  1991-08-26  |  11.2 KB

  1. Path: uunet!cs.utexas.edu!sun-barr!cronkite.Central.Sun.COM!exodus!trantor.harris-atd.com
  2. From: chuck@trantor.harris-atd.com (Chuck Musciano)
  3. Newsgroups: comp.sources.x
  4. Subject: v14i004: contool, Patch1, Part01/01
  5. Message-ID: <19069@exodus.Eng.Sun.COM>
  6. Date: 27 Aug 91 05:31:33 GMT
  7. References: <csx-14i004-contool@uunet.UU.NET>
  8. Sender: news@exodus.Eng.Sun.COM
  9. Lines: 340
  10. Approved: argv@sun.com
  11.  
  12. Submitted-by: Chuck Musciano <chuck@trantor.harris-atd.com>
  13. Posting-number: Volume 14, Issue 4
  14. Archive-name: contool/patch1
  15. Patch-To: contool: Volume 10, Issue 34-40
  16. Patch-To: contool: Volume 10, Issue 78
  17. Patch-To: contool: Volume 11, Issue 5
  18. Patch-To: contool: Volume 13, Issue 54 55
  19.  
  20.      This is patch 1 to Contool 3.1, bringing Contool to version 3.1a.  This
  21. patch fixes a few typos in the man page, provides better support for console
  22. message lacking trailing newlines, and supports saving its command line
  23. options upon receipt of appropriate signals from a window manager.
  24.  
  25.      You'll need Contool 3.1 to apply these patches.  Contool 3.1 is available
  26. via FTP and archive server from uunet.uu.net, and via FTP from
  27. trantor.harris-atd.com, in the /pub/suntools/contool directory.
  28.  
  29.  
  30. Chuck Musciano                ARPA  : chuck@trantor.harris-atd.com
  31. Harris Corporation             Usenet: ...!uunet!x102a!trantor!chuck
  32. PO Box 37, MS 3A/1912            AT&T  : (407) 727-6131
  33. Melbourne, FL 32902            FAX   : (407) 729-3363
  34.  
  35. A good newspaper is never good enough,
  36.     but a lousy newspaper is a joy forever.        -- Garrison Keillor
  37.  
  38. #!/bin/sh
  39. # This is a shell archive (produced by shar 3.49)
  40. # To extract the files from this archive, save it to a file, remove
  41. # everything above the "!/bin/sh" line above, and type "sh file_name".
  42. #
  43. # made 07/31/1991 11:48 UTC by chuck@melmac
  44. # Source directory /home/chuck/projects/release/contool/3.1/patch01
  45. #
  46. # existing files will NOT be overwritten unless -c is specified
  47. #
  48. # This shar contains:
  49. # length  mode       name
  50. # ------ ---------- ------------------------------------------
  51. #   8711 -rw-rw-r-- patch
  52. #
  53. # ============= patch ==============
  54. if test -f 'patch' -a X"$1" != X"-c"; then
  55.     echo 'x - skipping patch (File already exists)'
  56. else
  57. echo 'x - extracting patch (Text)'
  58. sed 's/^X//' << 'SHAR_EOF' > 'patch' &&
  59. *** Imakefile.orig    Wed Jul 24 09:15:40 1991
  60. --- Imakefile    Fri May 31 08:03:38 1991
  61. ***************
  62. *** 8,15 ****
  63. X  
  64. X  LDOPTIONS    = -L$(OPENWINHOME)/lib
  65. X  
  66. ! CFLAGS        = -O -I$(OPENWINHOME)/include -DMAILER=\"$(MAILER)\"
  67. X  
  68. X  SRCS        = about.c busy.c contool.c contool_ui.c error.c expand.c filename_completion.c \
  69. X            filters.c getopt.c load.c load_icon.c logging.c misc.c parse.y \
  70. X            pinned_menu_notify.c place_dialog.c props.c regexp.c send_mail.c store.c
  71. --- 8,19 ----
  72. X  
  73. X  LDOPTIONS    = -L$(OPENWINHOME)/lib
  74. X  
  75. ! CPPFLAGS    = -I$(OPENWINHOME)/include
  76. X  
  77. + CFLAGS        = -O -DMAILER=\"$(MAILER)\"
  78. + EXTRA_INCLUDES    = -I$(OPENWINHOME)/include
  79. X  SRCS        = about.c busy.c contool.c contool_ui.c error.c expand.c filename_completion.c \
  80. X            filters.c getopt.c load.c load_icon.c logging.c misc.c parse.y \
  81. X            pinned_menu_notify.c place_dialog.c props.c regexp.c send_mail.c store.c
  82. ***************
  83. *** 20,24 ****
  84. X  
  85. X  ComplexProgramTarget(contool)
  86. X  
  87. ! install:: install.man
  88. X      $(INSTALL) -c $(INSTMANFLAGS) contool.info $(HELPDIR)/contool.info
  89. --- 24,30 ----
  90. X  
  91. X  ComplexProgramTarget(contool)
  92. X  
  93. ! install: install.man install.help
  94. ! install.help:
  95. X      $(INSTALL) -c $(INSTMANFLAGS) contool.info $(HELPDIR)/contool.info
  96. *** README.orig    Wed Jul 24 09:15:40 1991
  97. --- README    Wed Jul 24 09:15:33 1991
  98. ***************
  99. *** 16,22 ****
  100. X  /*    of Harris Corporation.                        */
  101. X  /************************************************************************/
  102. X  
  103. !      Contool Version 3.1
  104. X       
  105. X       Contool will capture and display system console messages with timestamps.
  106. X  It is a replacement for the standard Sun console, which is created with 
  107. --- 16,22 ----
  108. X  /*    of Harris Corporation.                        */
  109. X  /************************************************************************/
  110. X  
  111. !      Contool Version 3.1a
  112. X       
  113. X       Contool will capture and display system console messages with timestamps.
  114. X  It is a replacement for the standard Sun console, which is created with 
  115. ***************
  116. *** 198,205 ****
  117. X                  Contool now sets its class and name hints.
  118. X                  Sending SIGUSR1 (30) to contool stops blinking,
  119. X                     suggested by Frank Peters.
  120. !                 Sending SIGHUP (1) closes and reopens the log file.
  121. X                  Added "Apply and Save" button to filter dialog.
  122. X                  Added individual message logging.
  123. X                  Finally fixed overflow handling.
  124. X                  Added multi-line filter timeout.
  125. --- 198,213 ----
  126. X                  Contool now sets its class and name hints.
  127. X                  Sending SIGUSR1 (30) to contool stops blinking,
  128. X                     suggested by Frank Peters.
  129. !                 Sending SIGHUP (1) closes and reopens the log
  130. !                    file.
  131. X                  Added "Apply and Save" button to filter dialog.
  132. X                  Added individual message logging.
  133. X                  Finally fixed overflow handling.
  134. X                  Added multi-line filter timeout.
  135. +     3.1a    24 Jul 91    Added support for WIN_CMDLINE attribute,
  136. +                    from Tomas Stephanson
  137. +                    (Tomas.Stephanson@eua.ericsson.se)
  138. +                 Fixed handling of messages without trailing
  139. +                    newlines, suggested by Ellery Chan
  140. +                    (ellery@trantor.harris-atd.com)
  141. +                 Fixed typos in the man page
  142. *** contool.man.orig    Wed Jul 24 09:15:41 1991
  143. --- contool.man    Fri Jun 28 11:21:47 1991
  144. ***************
  145. *** 1,8 ****
  146. ! .TH CONTOOL 1 "13 October 1989"
  147. X  .SH NAME
  148. X  contool \- capture and display console output
  149. X  .SH SYNOPSIS
  150. ! contool [\fB\(hyf\fP \fIfile\fP] [\fB\(hyl\fP] [\f3\(hyL\fP \f2logfile\fP] [\f3\(hyn\fP]
  151. X  .SH DESCRIPTION
  152. X  .LP
  153. X  \f2Contool\fP captures and displays any messages sent to the system console.
  154. --- 1,8 ----
  155. ! .TH CONTOOL 1 "28 June 1991"
  156. X  .SH NAME
  157. X  contool \- capture and display console output
  158. X  .SH SYNOPSIS
  159. ! contool [\fB\(hyc\fP \fIfile\fP] [\fB\(hyl\fP] [\f3\(hyL\fP \f2logfile\fP] [\f3\(hyn\fP]
  160. X  .SH DESCRIPTION
  161. X  .LP
  162. X  \f2Contool\fP captures and displays any messages sent to the system console.
  163. *** contool.c.orig    Wed Jul 24 09:15:44 1991
  164. --- contool.c    Mon Jul 22 15:33:22 1991
  165. ***************
  166. *** 499,511 ****
  167. X      Filter    *f;
  168. X      int    count, do_blink = FALSE, do_open = FALSE;
  169. X      static    char    in_buf[INPUT_BUFFER_SIZE + 2];
  170. X  
  171. !     while ((count = read(fileno(master), in_buf, INPUT_BUFFER_SIZE)) >= 0) {
  172. !        in_buf[count] = '\0';
  173. !        while (s = index(in_buf, '\015')) {
  174. X            strcpy(s, s + 1);
  175. -           count--;
  176. -           }
  177. X         for (t = in_buf; *t; *s = old_c, t = s) {
  178. X            if (s = index(t, '\n')) {
  179. X               old_c = *++s;
  180. --- 499,511 ----
  181. X      Filter    *f;
  182. X      int    count, do_blink = FALSE, do_open = FALSE;
  183. X      static    char    in_buf[INPUT_BUFFER_SIZE + 2];
  184. +     static    int    leftover = 0;
  185. X  
  186. !     while ((count = read(fileno(master), in_buf + leftover, INPUT_BUFFER_SIZE - leftover)) >= 0) {
  187. !        in_buf[count + leftover] = '\0';
  188. !        leftover = 0;
  189. !        while (s = index(in_buf, '\015'))
  190. X            strcpy(s, s + 1);
  191. X         for (t = in_buf; *t; *s = old_c, t = s) {
  192. X            if (s = index(t, '\n')) {
  193. X               old_c = *++s;
  194. ***************
  195. *** 512,519 ****
  196. X               *s = '\0';
  197. X               }
  198. X            else {
  199. !              s = t + strlen(t);
  200. !              old_c = '\0';
  201. X               }
  202. X            if (!defaults.log_after)
  203. X               write_log(t);
  204. --- 512,520 ----
  205. X               *s = '\0';
  206. X               }
  207. X            else {
  208. !              leftover = strlen(t);
  209. !              strcpy(in_buf, t);
  210. !              break;
  211. X               }
  212. X            if (!defaults.log_after)
  213. X               write_log(t);
  214. ***************
  215. *** 608,627 ****
  216. --- 609,637 ----
  217. X  
  218. X  {    char    *s, c, path[1024], *log_file = NULL;
  219. X      int    log = FALSE;
  220. +     static    char    cmdline[MAXPATHLEN + 10];
  221. X  
  222. X      sprintf(path, "%s/.contool", getenv("HOME"));
  223. X      filter_file = strsave(path);
  224. X  
  225. +     cmdline[0] = NULL;
  226. X      while ((c = getopt(argc, argv, "c:lL:n?", &s)) != EOF)
  227. X         switch (c) {
  228. X            case 'c' : filter_file = expand_tilde(s);
  229. X                     explicit_filters = TRUE;
  230. +                  strcat(cmdline, " -c ");
  231. +              strcat(cmdline, filter_file);
  232. X                     break;
  233. X            case 'l' : log = TRUE;
  234. +                  strcat(cmdline, " -l");
  235. X                     break;
  236. X            case 'L' : log_file = expand_tilde(s);
  237. +                  strcat(cmdline, " -L ");
  238. +              strcat(cmdline, log_file);
  239. X                     break;
  240. X            case 'n' : no_console = TRUE;
  241. +                  strcat(cmdline, " -n");
  242. X                     break;
  243. X            case '?' : fprintf(stderr, ct_usage);
  244. X                     exit(0);
  245. ***************
  246. *** 629,634 ****
  247. --- 639,647 ----
  248. X            default  : fprintf(stderr, ct_usage);
  249. X                       exit(1);
  250. X            }
  251. +     if (strlen(cmdline) > 0)
  252. +         xv_set(contool_base->base, WIN_CMD_LINE, cmdline, NULL);
  253. X  
  254. X      if (lex_init(filter_file)) {
  255. X         yyparse();
  256. *** contool_ui.c.orig    Wed Jul 24 09:15:46 1991
  257. --- contool_ui.c    Wed Jul 24 09:13:28 1991
  258. ***************
  259. *** 349,355 ****
  260. X          XV_KEY_DATA, INSTANCE, ip,
  261. X          XV_WIDTH, 575,
  262. X          XV_HEIGHT, 246,
  263. !         XV_LABEL, "Contool 3.1",
  264. X          FRAME_CLOSED, FALSE,
  265. X          FRAME_SHOW_FOOTER, TRUE,
  266. X          FRAME_SHOW_RESIZE_CORNER, TRUE,
  267. --- 349,355 ----
  268. X          XV_KEY_DATA, INSTANCE, ip,
  269. X          XV_WIDTH, 575,
  270. X          XV_HEIGHT, 246,
  271. !         XV_LABEL, "Contool 3.1a",
  272. X          FRAME_CLOSED, FALSE,
  273. X          FRAME_SHOW_FOOTER, TRUE,
  274. X          FRAME_SHOW_RESIZE_CORNER, TRUE,
  275. ***************
  276. *** 2133,2143 ****
  277. X      obj = xv_create(owner, PANEL_MESSAGE,
  278. X          XV_KEY_DATA, INSTANCE, ip,
  279. X          XV_HELP_DATA, "contool:message1",
  280. !         XV_X, 217,
  281. X          XV_Y, 14,
  282. X          XV_WIDTH, 75,
  283. X          XV_HEIGHT, 13,
  284. !         PANEL_LABEL_STRING, "Contool 3.1",
  285. X          PANEL_LABEL_BOLD, TRUE,
  286. X          NULL);
  287. X      return obj;
  288. --- 2133,2143 ----
  289. X      obj = xv_create(owner, PANEL_MESSAGE,
  290. X          XV_KEY_DATA, INSTANCE, ip,
  291. X          XV_HELP_DATA, "contool:message1",
  292. !         XV_X, 212,
  293. X          XV_Y, 14,
  294. X          XV_WIDTH, 75,
  295. X          XV_HEIGHT, 13,
  296. !         PANEL_LABEL_STRING, "Contool 3.1a",
  297. X          PANEL_LABEL_BOLD, TRUE,
  298. X          NULL);
  299. X      return obj;
  300. *** filename_completion.c.orig    Wed Jul 24 09:15:50 1991
  301. --- filename_completion.c    Wed Jul 17 15:42:21 1991
  302. ***************
  303. *** 41,47 ****
  304. X  
  305. X      switch (event_action(event)) {
  306. X         case '\n' :
  307. !        case '\r' :
  308. X         case ' '  : if ((p = expand_filename((char *) xv_get(item, PANEL_VALUE))) == NULL)
  309. X                   window_bell(xv_get(item, XV_OWNER));
  310. X                    else
  311. --- 41,47 ----
  312. X  
  313. X      switch (event_action(event)) {
  314. X         case '\n' :
  315. !        case '\r' : 
  316. X         case ' '  : if ((p = expand_filename((char *) xv_get(item, PANEL_VALUE))) == NULL)
  317. X                   window_bell(xv_get(item, XV_OWNER));
  318. X                    else
  319. *** patchlevel.h.orig    Wed Jul 24 09:15:56 1991
  320. --- patchlevel.h    Mon Jul 22 15:35:48 1991
  321. ***************
  322. *** 33,37 ****
  323. --- 33,41 ----
  324. X  /*               comp.sources.x: Volume 11, Issue 4        */
  325. X  /*                                    */
  326. X  /*      4        Release of version 3.1; see README for details    */
  327. + /*               comp.sources.x: Volume 13, Issues 54 & 55    */
  328. + /*                                    */
  329. + /*      5        Bug fixes; see README for details        */
  330. + /*               comp.sources.x: Volume ??, Issue ??        */
  331. X  /*                                    */
  332. X  /************************************************************************/
  333. SHAR_EOF
  334. chmod 0664 patch ||
  335. echo 'restore of patch failed'
  336. Wc_c="`wc -c < 'patch'`"
  337. test 8711 -eq "$Wc_c" ||
  338.     echo 'patch: original size 8711, current size' "$Wc_c"
  339. fi
  340. exit 0
  341.  
  342. --
  343. Dan Heller
  344. O'Reilly && Associates       Z-Code Software    Comp-sources-x:
  345. Senior Writer                President          comp-sources-x@uunet.uu.net
  346. argv@ora.com                 argv@zipcode.com
  347.